# Maintainer: Daniel Isenmann <daniel@archlinux.org>

pkgname=gegl
_tag='0a29f670c2c4052017908ae705f83954c0204287'
pkgver=0.4.32
pkgrel=2
pkgdesc="Graph based image processing framework"
arch=('x86_64')
url="https://www.gegl.org/"
license=('GPL3' 'LGPL3')
depends=('babl' 'libspiro' 'json-glib' 'libgexiv2' 'libraw' 'openexr' 'librsvg' 'libtiff' 'luajit' 'jasper' 'lensfun' 'suitesparse' 'poppler-glib')
makedepends=('intltool' 'ruby' 'mesa' 'glu' 'ffmpeg' 'exiv2' 'vala' 'gobject-introspection' 'git' 'meson' 'python-gobject')
optdepends=('ffmpeg: ffmpeg plugin' 'graphviz: for gegl-introspect')
source=("git+https://gitlab.gnome.org/GNOME/gegl.git#tag=$_tag")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GEGL_//;s/_$//;s/_/./g;s/-/+/g'
}

build() {
  mkdir -p build
  cd build
  arch-meson ../$pkgname \
    -Dworkshop=true \
    -Dmrg=disabled \
    -Dmaxflow=disabled
  ninja
}

check() {
  cd build
  ninja test || :
}

package() {
  cd build
  DESTDIR="${pkgdir}" ninja install
}
